package com.zf.shuashua.ui.home;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zf.shuashua.R;
import com.zf.shuashua.bean.CommentBean;

import java.util.List;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;

public class CommentReturnAdapter extends BaseQuickAdapter<CommentBean.DataBean.ReplysBean, BaseViewHolder> {

    public CommentReturnAdapter(int layoutResId, @Nullable List data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CommentBean.DataBean.ReplysBean item) {
        Glide.with(mContext)
                .load(item.getUser().getAvatar())
                .placeholder(R.mipmap.ic_launcher)
                .into((ImageView) helper.getView(R.id.avatar));
        helper.setText(R.id.name, "@"+item.getUser().getName())
                .setText(R.id.comment, item.getContent())
                .setText(R.id.tv_time,item.getCreated_time());

    }

}